package cn.ac.jaas.isc.vegetable.admin.api.feign;

import cn.ac.jaas.isc.vegetable.admin.api.entity.SysTenant;
import cn.ac.jaas.isc.vegetable.common.core.constant.SecurityConstants;
import cn.ac.jaas.isc.vegetable.common.core.constant.ServiceNameConstants;
import cn.ac.jaas.isc.vegetable.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * @author 张高昌
 * @date 2022/4/28 18:24
 * @description: 租户接口
 */
@FeignClient(contextId = "remoteTenantService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteTenantService {

    /**
     * 查询全部有效租户
     *
     * @param from 内部标志
     * @return
     */
    @GetMapping("/tenant/list")
    R<List<SysTenant>> list(@RequestHeader(SecurityConstants.FROM) String from);
}
